home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6163 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: kuhub.cc.ukans.edu!anh
  2. From: anh@kuhub.cc.ukans.edu
  3. Newsgroups: comp.lang.c
  4. Subject: Re: unique id for a string
  5. Message-ID: <1996Feb22.175728.114586@kuhub.cc.ukans.edu>
  6. Date: 22 Feb 96 17:57:28 CST
  7. References: <1996Feb16.175601.114182@kuhub.cc.ukans.edu> <harmon.824680556@pegasus.montclair.edu>
  8. Organization: University of Kansas Academic Computing Services
  9.  
  10. In article <harmon.824680556@pegasus.montclair.edu>, harmon@pegasus.montclair.edu (Derek Harmon) writes:
  11. > anh@kuhub.cc.ukans.edu writes:
  12. >>This is not a quite a C problem. But since the implementation will be in 
  13. >>C anyway.
  14. >  
  15. >    Then I won't quite give an answer in C.  :)
  16.  
  17. ML, Smalltalk, Prolog, Scheme, Common Lisp, C++, JAVA, Machine Code, 
  18. Pascal, Perl, Shell script, Awk script, work fine too. :-)
  19.  
  20. The reason I though a posting here would yield a good result is that, 
  21. REAL (read best) PROGRAMMERS DO IT IN C. :-)
  22.  
  23. >>Another way is to simply assign a id to a word and store the word in a 
  24. >>binary search tree, and therefore, it is relatively fast to make sure 
  25. >>each word has an unique id. But I think it is still to slow. We are 
  26. >>talking about a possible 200,000+ words. 
  27.  
  28. >    How balanced the tree would be depends on either the order of input, or
  29. > the tree's self-balancing of itself which makes input longer, but logarith-
  30. > mically lowers the bound on search time.  But we are talking about more than
  31. > 200,000 words here, and that is where the problem occurs.  If the max length
  32. > of these strings is 32 characters, then we are talking about roughly 7.3 x
  33. > 10^43 different strings.  That will not fit into a 64-bit long.  :)
  34.  
  35. I don't understand the 10^43 number? You must be talking about the 
  36. permutations of strings of 32 characters? 
  37.   
  38. >                                                     -- Stone
  39.  
  40. Anh
  41.